
#include <stdlib.h>

#include "ev_event.h"


EV_EVENT_S* EV_event_Create(EV_DISPATCHER_S* pstDP, int iEventFd, unsigned int uiFlags, void (*pfCallback)(int, void*), void* pCBArg)
{
    EV_EVENT_S* pstEvent = (EV_EVENT_S*)malloc(sizeof(EV_EVENT_S));
    if (pstEvent == NULL)
    {
        return NULL;
    }

    pstEvent->pstDP = pstDP;
    pstEvent->iEventFd = iEventFd;
    pstEvent->uiFlags = uiFlags;
    pstEvent->pfCallback = pfCallback;

    if (pCBArg == NULL)
    {
        pstEvent->pCBArg = pstEvent;
    }
    else
    {
        pstEvent->pCBArg = pCBArg;
    }

    return pstEvent;
}


void EV_event_Destroy(EV_EVENT_S* pstEvent)
{

}



int EV_event_GetFd(EV_EVENT_S* pstEvent)
{
    return pstEvent->iEventFd;
}
